%entry point for the AoT based 3D car template learning project.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Section 0, configuration and parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
configPath = './config'; % path for root node configuration file
LHIPath = 'D:\Projects\AoT\data';



addpath('./libFilter');
%makeLibFilter;

default_filter_param;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Section 1, set up the AoT for learning
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
generateTanConfiguration(configPath);
config_files = dir([configPath '/*.tan']);
AoTs = [];
AoTParams = [];
for i_file = 1:length(config_files)
    AoT_param = parseConfigFile(configPath,config_files(i_file).name);
    AoTParams=[AoTParams;( AoT_param)];
end
for i_tree = 1
    corner = AoTParams(i_tree).corner;
    dim = AoTParams(i_tree).size;
    
    AoT = createTree(corner,dim(1),dim(2),dim(3),...
            AoTParams(i_tree).asp_low_limit,AoTParams(i_tree).asp_high_limit,...
            AoTParams(i_tree).rotationMatrix, AoTParams(i_tree).swt,AoTParams(i_tree).stp);
    AoTs = [AoTs;AoT];
end
